<template>
  <view class="success-page">
    <!-- 成功提示 -->
    <view class="success-icon">✅</view>
    <view class="success-title">下单成功</view>
    
    <!-- 订单信息 -->
    <view class="order-info">
      <view class="info-item">
        <text class="label">订单金额</text>
        <text class="value">¥{{ orderAmount }}</text>
      </view>
      <view class="info-item">
        <text class="label">支付方式</text>
        <text class="value">{{ payMethod }}</text>
      </view>
    </view>
    
    <!-- 操作按钮 -->
    <view class="button-group">
      <view class="btn primary" @tap="viewOrder">查看订单</view>
      <view class="btn default" @tap="backToHome">返回首页</view>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'

// 订单金额和支付方式应该从路由参数或状态管理中获取
const orderAmount = ref('0.00')
const payMethod = ref('微信支付')

// 查看订单详情
const viewOrder = () => {
  uni.navigateTo({
    url: '/pages/order/detail'
  })
}

// 返回首页
const backToHome = () => {
  uni.switchTab({
    url: '/pages/index/index'
  })
}
</script>

<style>
.success-page {
  min-height: 100vh;
  background: #fff;
  padding: 60rpx 40rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-icon {
  font-size: 120rpx;
  margin-bottom: 40rpx;
}

.success-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 60rpx;
}

.order-info {
  width: 100%;
  background: #f8f8f8;
  border-radius: 16rpx;
  padding: 30rpx;
  margin-bottom: 80rpx;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20rpx;
}

.info-item:last-child {
  margin-bottom: 0;
}

.label {
  color: #666;
  font-size: 28rpx;
}

.value {
  color: #333;
  font-size: 28rpx;
  font-weight: 500;
}

.button-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30rpx;
}

.btn {
  width: 100%;
  height: 88rpx;
  border-radius: 44rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32rpx;
}

.primary {
  background: #1890ff;
  color: #fff;
}

.default {
  background: #f5f5f5;
  color: #333;
}
</style> 